#include <stdio.h>

int main() {
	double a[10][10];
	printf("Please enter the row and the column (Numbered from 0) : \n");
	int r, c;
	scanf("%d%d", &r, &c);
	printf("%d\n", 	(&a[r][c] - &a[0][0]) * 8);
	return 0;
}